import { Module } from '@nestjs/common';
import { UserController } from './user.controller';
import { UserService } from './user.service'
import { TypeOrmModule } from '@nestjs/typeorm';
import { UsersEntity } from './user.entity';
import { JwtModule } from '@nestjs/jwt';
import { ConfigModule, ConfigService } from 'nestjs-config';

@Module({
  imports: [TypeOrmModule.forFeature([UsersEntity]),
  JwtModule.registerAsync({
    imports: [ConfigModule],
    useFactory: async (config: ConfigService) => config.get('jwt'),
    inject: [ConfigService],
  })],
  controllers: [UserController],
  providers: [UserService,],
})
export class UserModule { }
